// @ts-ignore
/* eslint-disable */
import {postRequest, postRequestPromise} from '@/utils/postRequest';
import request from '@/utils/request';

/** 获取友情链接列表  */
export async function getLinkList(param: any, data: any) {
  return request('/api/v1/link/getLinkList', {
    method: 'POST',
    params: param,
    data: data,
  });
}

/** 获取友情链接类型列表  */
export async function getLinkTypeList() {
  return request('/api/v1/link/getLinkTypeList', {
    method: 'GET',
  });
}
export async function getWebSiteInfo() {
  return request('/api/v1/link/getWebsiteInfo', {
    method: 'GET',
  });
}
export async function updateWebsiteInfo(data: any) {
  return request('/api/v1/link/updateWebsiteInfo', {
    method: 'POST',
    data: data,
  });
}

/** 修改链接  */
export async function updateLink(params: any) {
  return postRequestPromise('/api/v1/link/updateLink', params);
}

/** 修改链接类型  */
export async function updateLinkType(params: any) {
  return request('/api/v1/link/updateLinkType', {
    method: 'POST',
    data: params,
  });
}

/** 新建链接 */
export async function insertLink(params: any) {
  return request('/api/v1/link/insertLink', {
    method: 'POST',
    data: params,
  });
}
/** 新建链接类型 */
export async function insertLinkType(params: any) {
  return request('/api/v1/link/insertLinkType', {
    method: 'POST',
    data: params,
  });
}

/** 删除链接  */
export async function deleteLinkById(params: any) {
  return request('/api/v1/link/deleteLinkById', {
    method: 'POST',
    params: params,
  });
}
/** 删除链类型  */
export async function deleteLinkTypeById(params: any) {
  return request('/api/v1/link/deleteLinkTypeById', {
    method: 'POST',
    params: params,
  });
}
export async function changeLinkOrder(params: any) {
  return request('/api/v1/link/changeOrder', {
    method: 'POST',
    data: params,
  });
}
